package main

import "fmt"

type specialString string

func main() {
	typeSwitch := TypeSwitch()

	var whatIsThis specialString = "hello"
	typeSwitch(whatIsThis)

	i2 := 1
	typeSwitch(i2)

	str := "str"
	typeSwitch(str)

}

func TypeSwitch() func(any interface{}) {
	testFunc := func(any interface{}) {
		switch v := any.(type) {
		case bool:
			fmt.Printf("any %v is a bool type\n", v)
		case int:
			fmt.Printf("any %v is an int type\n", v)
		case float32:
			fmt.Printf("any %v is a float32 type\n", v)
		case string:
			fmt.Printf("any %v is a string type\n", v)
		case specialString:
			fmt.Printf("any %v is a special String!\n", v)
		default:
			fmt.Println("unknown type!\n")
		}
	}
	return testFunc
}
